import { defAxios as request } from '@/utils/http'
/**
 * 首页-获取最新五条任务
 * @returns
 */
export const getInspectionListHome = data => request({
  url: `/inspection/getInspectionList`,
  method: 'GET'
})
/**
 * 立即执行任务
 * @returns
 */
export const executeTask = data => request({
  url: `/inspection/execute/${data}`,
  method: 'POST'
})
/**
 * 获取当前租户下公路列表
 * @returns
 */
export function getEmergencyList(params) {
  return request({
    url: `/accident/index`,
    method: 'GET',
    params
  })
}
/**
 * 根据事件id获取应急事件详情数据
 * @returns
 */
export function getDescription(params) {
  return request({
    url: `/accident/getInfo`,
    method: 'GET',
    params
  })
}
/**
 * 根据事件id获取应急事件时间线
 * @returns
 */
export function getTimeLine(params) {
  return request({
    url: `/accident/timeAxis/${params}`,
    method: 'GET'
  })
}
/**
 * 应急弹窗通知下发
 * @returns
 */
export function getEmerNotice(params) {
  return request({
    url: `/accident/notice`,
    method: 'GET'
  })
}
/**
 * 标记应急弹窗通知已读状态
 * @returns
 */
export function signReadStatus(params) {
  return request({
    url: `/accidentRead/add/${params}`,
    method: 'POST'
  })
}
/**
 * 首页应急事故-事故卡片
 * @returns
 */
export function getAccidentCardList(params) {
  return request({
    url: `/accident/card/list`,
    method: 'GET',
    params
  })
}
/**
 * 首页应急事故-忽略事故
 * @returns
 */
export function accidentIgnore(params) {
  return request({
    url: `/accident/ignore/${params}`,
    method: 'POST'
  })
}
/**
 * 首页应急事故-核实事故
 * @returns
 */
export function accidentConfirm(params) {
  return request({
    url: `/accident/verify`,
    method: 'POST',
    params
  })
}
/**
 * 首页应急事故-获取机场列表
 * @returns
 */
export function getAirportList(params) {
  return request({
    url: `/airport/list`,
    method: 'GET'
  })
}
/**
 * 事故核实-上报
 * @returns
 */
export function setReportAccident(params) {
  return request({
    url: `/accident/report/accident`,
    method: 'POST',
    params
  })
}
/**
 * 事故核实-无事故
 * @returns
 */
export function setNoAccident(params) {
  return request({
    url: `/accident/report/accident`,
    method: 'POST',
    params
  })
}
/**
 * 事故核实-完成
 * @returns
 */
export function verifyComplete(params) {
  return request({
    url: `/accident/verify/completed`,
    method: 'POST',
    params
  })
}
/**
 * 根据机场id获取巡检任务直播
 * @returns
 */
export function getVideoByAirportId(params) {
  return request({
    url: `/inspection/videoByAirportId/${params}`,
    method: 'GET'
  })
}
/**
 * 应急飞行起飞
 * @returns
 */
export function pointFlight(params) {
  return request({
    url: `/airport/pointFlight`,
    method: 'POST',
    params
  })
}
/**
 * 应急飞行回舱
 * @returns
 */
export function reversalFlight(params) {
  return request({
    url: `/airport/reversalFlight`,
    method: 'POST',
    params
  })
}
/**
 * 应急飞行机场面板 - 机场详细信息
 * @returns
 */
export function getAirportMsg(params = {}) {
  return request({
    url: `/index/getAirportMsg/${params}`,
    method: 'GET'
  })
}
/**
 * 应急飞行机场面板 - 飞行数据
 * @returns
 */
export function flyInfo(params = {}) {
  return request({
    url: `/airport/drone/data/${params}`,
    method: 'GET'
  })
}

/**
 * 事故告警提示
 * @param {*} id
 * @returns
 */
export function accidentTip(id) {
  return request({
    url: `/accident/tips/${id}`,
    method: 'GET'
  })
}

/**
 * 事故告警提示
 * @param {*} id
 * @returns
 */
export function accidentDetail(id) {
  return request({
    url: `/inspection/detailsById/${id}`,
    method: 'GET'
  })
}

